package fr.charlesen.projets.utt.lo09.entites;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Charles EDOU NZE
 */
@Entity
@Table(name = "PROGRAMMES", catalog = "", schema = "CHARLES")
@NamedQueries({
    @NamedQuery(name = "Programmes.findAll", query = "SELECT p FROM Programmes p"),
    @NamedQuery(name = "Programmes.findById", query = "SELECT p FROM Programmes p WHERE p.id = :id")})
public class Programmes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    
    @JoinColumn(name = "ID_RESPSTAGES", referencedColumnName = "ID")
    @OneToOne
    private Respstages idRespstages;

    @JoinColumn(name = "ID_RESPPROG", referencedColumnName = "ID")
    @OneToOne
    private Respprogramme idRespprog;

    @JoinColumn(name = "ID_SUIVEUR", referencedColumnName = "ID")
    @ManyToOne
    private Enseignantsuiveur idSuiveur;

    public Programmes() {
    }

    public Programmes(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Respstages getIdRespstages() {
        return idRespstages;
    }

    public void setIdRespstages(Respstages idRespstages) {
        this.idRespstages = idRespstages;
    }

    public Respprogramme getIdRespprog() {
        return idRespprog;
    }

    public void setIdRespprog(Respprogramme idRespprog) {
        this.idRespprog = idRespprog;
    }

    public Enseignantsuiveur getIdSuiveur() {
        return idSuiveur;
    }

    public void setIdSuiveur(Enseignantsuiveur idSuiveur) {
        this.idSuiveur = idSuiveur;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Programmes)) {
            return false;
        }
        Programmes other = (Programmes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.charlesen.projets.utt.lo09.enites.Programmes[id=" + id + "]";
    }

}
